<?php 
require_once $_SERVER["DOCUMENT_ROOT"]."/inc/core/env.inc.php";

$return["success"] = false; 
$return["html"] = null;
$return["error"] = null;

if ($_USER->login) {	
		$return["success"] = true;
		
		//form user
		$frm = file_get_contents($_SITE['path']['dir']['blocks']['containers']['admin'].'/admin-frm-user-add.tag.html');
		$frm = str_replace($_TAGS["admin-frm-user-id"], "0", $frm);
		$frm = str_replace($_TAGS["admin-frm-user-name"], "", $frm);
		$frm = str_replace($_TAGS["admin-frm-user-surname"], "", $frm);
		$frm = str_replace($_TAGS["admin-frm-user-nick"], "", $frm);
		$frm = str_replace($_TAGS["admin-frm-user-email"], "", $frm);
		$frm = '<li>'.$frm.'</li>';
				
		$return["html"] = file_get_contents($_SITE['path']['dir']['blocks']['containers']['admin'].'/admin-rows.tag.html');
		$return["html"] = str_replace($_TAGS["admin-frm-add-permission"], $frm, $return['html']);
		
} else {
	$return["error"] = $_TRANSLATE->traslate('{VOCABULARY|permission_disactive}', $_SESSION['LANGUAGE']);
}

echo '('.json_encode($return).')';
?>